<?php
namespace Library;

//	公共工具处理
class Common
{
	//	处理引入路径及类名
	public static function rePath($url){
		$urlArray = explode("/",$url);
		$newArray = [];
		$namespace = "app\\".$urlArray[1]."\\Controller";
		$Path = "app/".ucfirst($urlArray[1])."/Controller";
		for($i=2;$i<count($urlArray)-1;$i++)
		{
			$Path = $Path."/".ucfirst($urlArray[$i]);
			$urlArray[$i] = ucfirst($urlArray[$i]);
		}
		return ["path"=>$Path.".php","pathArray"=>$urlArray];
	}

	//	初始路径完整补充
	public static function completePath($path){
		if ( empty($path) || $path=="index.php" || $path=="index.php/" || $path==""){
			$path = "/Index/Index/index";
		}
		return $path;
	}
}



?>